<template>
  <div class="contact-box" id="contact">
    <div class="about-content-box main-content" style="display: none;">
      <div class="content-item-box contact-box">
        <div class="content-title-box">
          <div>联系我们</div>
          <div class="item-line-box"></div>
          <div class="item-dec-box">
            在这里向鲸势咨询更多信息，我们将竭诚解答您的问题
          </div>
        </div>
        <div class="content-contact-box">
          <a-form-model :model="form" :rules="rules" ref="ruleForm">
            <a-form-model-item prop="name">
              <a-input v-model="form.name" placeholder="姓名"></a-input>
            </a-form-model-item>
            <a-form-model-item prop="phone">
              <a-input
                v-model="form.phone"
                placeholder="联系电话(必填)"
              ></a-input>
            </a-form-model-item>
            <a-form-model-item prop="enterprise">
              <a-input
                v-model="form.enterprise"
                placeholder="公司名称(必填)"
              ></a-input>
            </a-form-model-item>
            <a-form-model-item class="textarea-box" prop="message">
              <a-textarea
                v-model="form.message"
                placeholder="请在此输入留言内容，我们将尽快与您联系(必填)"
                allow-clear
              />
            </a-form-model-item>
          </a-form-model>

          <a-button class="bottom-send-btn" @click="hkClickSend">发送</a-button>
        </div>
      </div>
    </div>

    <div
      class="map-address-box"
      v-bind:class="{ 'mobile-map-address-box': isMobile }"
    >
      <div class="mobile-content-box content-box">
        <div class="address-card-box">
          <div class="city-box">上海</div>
          <div class="address-box">
            上海市曲阳路930号大柏树930创意产业园C栋2层
          </div>
          <div class="locations-box">
            <img src="../../assets/about/icon_location.png" alt="" />
          </div>
        </div>

        <div class="maps-box">
          <img src="../../assets/about/icon_maps.png" alt="" />
        </div>
      </div>
    </div>
    <a-divider></a-divider>

    <div class="bottom-contact-box main-content" style="display: none;">
      <div class="contact-item-box">
        <div class="item-title-box">
          商务联系
        </div>
        <div class="item-phone-box">
          400-967-8869
        </div>
        <div class="item-email-box">
          <router-link to="#">infojingshi@gmail.com</router-link>
        </div>
      </div>
      <a-divider type="vertical"></a-divider>

      <div class="contact-item-box">
        <div class="item-title-box">
          技术支持
        </div>
        <div class="item-phone-box">
          400-967-8869
        </div>
        <div class="item-email-box">
          <router-link to="#">infojingshi@gmail.com</router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      isMobile: this.$store.getters.isMobile,
      form: {
        name: "",
        phone: "",
        enterprise: "",
        message: "",
      },
      rules: {
        name: [
          {
            message: "请输入姓名",
            trigger: ["blur", "change"],
          },
        ],
        phone: [
          {
            required: true,
            message: "请输入联系电话",
            trigger: ["blur", "change"],
          },
        ],
        enterprise: [
          {
            required: true,
            message: "请输入公司名称",
            trigger: ["blur", "change"],
          },
        ],
        message: [
          {
            required: true,
            message: "请在此输入留言内容",
            trigger: ["blur", "change"],
          },
        ],
      },
    };
  },
  watch: {
    "$store.getters.isMobile"(newVal, oldVal) {
      this.isMobile = newVal;
    },
  },
  computed: {},
  methods: {
    hkClickSend() {
      this.$refs.ruleForm.validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
   
  },
  created() {

  },
  mounted() {},
};
</script>
<style lang="scss" scoped>
.about-content-box {
  margin-top: 60px;
  .content-item-box {
    text-align: center;
    .content-title-box {
      font-size: 38px;
      font-weight: 800;
      color: #444444;
      line-height: 57px;
      letter-spacing: 1px;
    }
    .item-line-box {
      margin: 20px auto;
      width: 36px;
      height: 2px;
      background: linear-gradient(223deg, #0781ff 0%, #31a3ff 100%);
    }
    .item-dec-box {
      font-size: 12px;
      font-weight: 400;
      color: #868686;
      line-height: 18px;
    }
    .content-text-box {
      text-align: left;
      font-weight: 300;
      color: #444444;
      line-height: 25px;
      .text-item-box {
        margin: 15px 0;
      }
    }
  }
  .contact-box {
    margin: 100px;
    .content-contact-box {
      margin: 37px auto;
      max-width: 446px;
      ::v-deep .ant-col {
        background: #f5f6f8;
        padding: 0 18px;
        border-radius: 8px;
        input,
        textarea {
          border: none;
          background: transparent;
        }
        textarea {
          margin-top: 18px;
          height: 129px;
        }
      }
    }
  }
}
.bottom-send-btn {
  background: linear-gradient(223deg, #0781ff 0%, #31a3ff 100%);
  border-radius: 2px;
  width: 150px;
  height: 43px;
  color: white;
  margin-top: 22px;
}
.ant-divider-horizontal {
  margin: 0;
}
.map-address-box {
  height: 600px;
  background: #f9fcfc;
  display: flex;
  align-items: center;

  .content-box {
    max-width: 1083px;
    margin: 0 auto;
    .address-card-box {
      position: relative;
      z-index: 100;
      top: 45px;
      margin-left: calc(33%);
      width: 187px;
      height: 150px;
      background: #ffffff;
      box-shadow: 0px 4px 18px 0px rgba(0, 0, 0, 0.12);
      border-radius: 8px;
      text-align: center;
      padding: 20px 30px;
      .city-box {
        margin-bottom: 10px;
        font-size: 16px;
        font-weight: 600;
        color: #444444;
        line-height: 22px;
      }
      .address-box {
        font-size: 12px;
        font-weight: 400;
        color: #747474;
        line-height: 18px;
        letter-spacing: 1px;
      }
    }
    .locations-box {
      position: relative;
      bottom: -1.25rem;
    }
    .maps-box {
      position: relative;
      margin-top: -3.75rem;
      z-index: 99;
      img {
        width: 100%;
      }
    }
  }
}
.mobile-map-address-box {
  height: 300px;
  .mobile-content-box {
    .address-card-box {
      top: -15px;
      margin-left: calc(17%);
      height: 100px;
      padding: 15px;
    }
    .locations-box {
      position: relative;
      bottom: 8px;
    }
    .maps-box {
      position: relative;
      margin-top: -3.75rem;
      z-index: 99;
      img {
        width: 100%;
      }
    }
  }
}
.bottom-contact-box {
  margin: 40px auto;
  display: flex;
  align-items: center;
  max-width: 600px;
  justify-content: space-around;

  .contact-item-box {
    text-align: center;
    .item-title-box {
      font-size: 16px;
      font-weight: 800;
      color: #444444;
      line-height: 24px;
    }
    .item-phone-box {
      font-size: 14px;
      font-weight: 400;
      color: #444444;
      line-height: 21px;
      margin: 20px 0 8px 0;
    }
  }
}
</style>
